<template>
    <!-- <v-breadcrumbs :items="items" divider=">"></v-breadcrumbs> -->
    <div class="r-page keep-px">
        <div class="u-pro">
            <div class="u-box">
                <img src="@/assets/head.svg" class="pro-img" />
                <div class="user">
                    <VRow class="had" no-gutters>
                        <VCol cols="12" class="d-flex flex-column">
                            <span>{{ $t("message.User.nickname") }}</span>
                            <!-- <span class="wit wit_use c-title-2" v-if="user.info?.userType == 3">{{
                                user.info?.userName }}</span> -->
                            <span class="wit wit_use c-title-2">{{ user.info?.userName }}</span>
                        </VCol>
                    </VRow>
                    <VRow class="list" no-gutters>
                        <VCol class="col0" cols="3">
                            <span class="info-lable">
                                {{ $t("message.User.userID") }}
                            </span>
                            <span class="wit">{{ user.info?.id }}</span>
                        </VCol>
                        <VCol class="col1" cols="3">
                            <span class="info-lable">{{ $t("message.User.enrollTime") }}</span>
                            <span class="wit">{{ user.info?.regTime ? formatTimestamp(new
                                Date(user.info?.regTime).getTime()) : '-' }}</span>
                        </VCol>
                        <VCol class="col2" cols="3">
                            <span class="info-lable">{{ $t("message.User.lastLoginTime") }}</span>
                            <span class="wit">{{ user.device?.loginTime ? formatTimestamp(user.device?.loginTime) : '-'
                            }}</span>
                        </VCol>
                        <VCol class="col3" cols="3">
                            <span class="info-lable">{{ $t("message.User.loginDevice") }}</span>
                            <span class="wit">{{ user.device?.deviceId }}</span>
                        </VCol>
                    </VRow>
                </div>
            </div>
        </div>
        <NSetting></NSetting>
        <div class="seeting">
            <Setting></Setting>
        </div>
    </div>
</template>

<script lang="ts" setup>
import { onMounted } from "vue";
import { formatTimestamp, formatHashName } from "@/comm/format";
import { user, User } from "./script/user";
import Setting from "@/views/setting/index.vue";
import NSetting from "./components/setting.vue";
import { useUser } from "@/stores/user"
import { useAccount } from "@/stores/account";

const userInfo = useUser();
const account = useAccount();

onMounted(async () => {
    // console.log('查看是否没有邮箱', userInfo.noEmail)
    await User.getData();
    // if (userInfo?.noEmail) {
    //     account.changeIsBindEmail(true);
    //     account.changePopRegister(true);
    // }
    // let isLogin = await userInfo.checkLogin();
    // if (isLogin) {
    //     // await user.getUserInfo();
    //     if (userInfo.noEmail) {
    //         account.changeIsBindEmail(true);
    //         account.changePopRegister(true);
    //     }
    //     return;
    // }

});
</script>

<style lang="less" scoped>
@import url("./index.less");
</style>
